<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
    <title>iPersistence</title>
    <style>
        body {
            -webkit-font-smoothing: antialiased;
            font-family: Helvetica Neue, Helvetica, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
            background-image: url('bg.jpg');
            font-size: 100%;
            margin: 0;
        }
        
        h2 {
            font-size: 220%;
            font-weight: 400;
        }
        
        .content {
            position: absolute;
            width: 100%;
            top: 40%;
            transform: translate(0, -50%);
            text-align: center;
        }
        
        .timer {
            font-size: 180%;
            line-height: 1.5;
            margin: 1em 0;
        }
        
        .timer b {
            color: rgb(253, 99, 125);
        }
    </style>
</head>

<body>
    <div class="content">
        <h1>香宝宝提示</h1>
        <h1>香宝宝提示</h1>
        <div class="timer">
            <text id="today"></text><b id="h"></b>分钟
        </div>
        <h1>！！！喏！！！</h1>
    </div>
    <script language="javascript">
        function timer() {
          window.setTimeout("show_date_time()", 1000);

            const now = new Date(); // 获取当前时间
            const targetTime = new Date(); // 创建目标时间对象
            targetTime.setHours(17, 30, 0, 0); // 设置目标时间为下午 5:30

            // 计算时间差（以分钟为单位）
            const timeDifference = Math.floor((targetTime - now) / (1000 * 60));

            if (timeDifference > 0){
                document.getElementById('today').textContent = "距离下班班还有"
                document.getElementById('h').innerHTML = timeDifference
            }else{
                document.getElementById('today').textContent = "已经下班"
            }

        }
        timer();
    </script>
    <!-->
    <script language="javascript">
	    function show_date_time() {
	        window.setTimeout("show_date_time()", 1000);
	        BirthDay = new Date("6/7/2018 00:00:00");//这个日期是可以修改的
	        today = new Date();
	        timeold = (today.getTime() - BirthDay.getTime());
	        sectimeold = timeold / 1000
	        secondsold = Math.floor(sectimeold);
	        msPerDay = 24 * 60 * 60 * 1000
	        e_daysold = timeold / msPerDay
	        daysold = Math.floor(e_daysold);
	        e_hrsold = (e_daysold - daysold) * 24;
	        hrsold = Math.floor(e_hrsold);
	        e_minsold = (e_hrsold - hrsold) * 60;
	        minsold = Math.floor((e_hrsold - hrsold) * 60);
	        seconds = Math.floor((e_minsold - minsold) * 60);
          document.getElementById('d').innerHTML = daysold;
          document.getElementById('h').innerHTML = hrsold;
          document.getElementById('m').innerHTML = minsold;
          document.getElementById('s').innerHTML = seconds;
	    }
	    show_date_time();
	</script>
  <!-->

</body>

</html>

